﻿@model MoskieBlog.Data.Models.Post

@{
    ViewBag.Title = "Blog";
    ViewBag.Message = "Edit";
}

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")"></script>

@section featured {
<div class="page-header">
    <h1>
        @ViewBag.Title
        <small>@ViewBag.Message</small>
    </h1>
</div>
}

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Post</legend>

        @Html.HiddenFor(model => model.PostId)

        <div class="editor-label">
            @Html.LabelFor(model => model.Title)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Title)
            @Html.ValidationMessageFor(model => model.Title)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Text)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Text)
            @Html.ValidationMessageFor(model => model.Text)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.PostedDate)
        </div>
        <div class="editor-field">
            @Html.DisplayFor(model => model.PostedDate)
        </div>

        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>
